﻿<UserControl x:Class="RSSReader.MobileClient.View.ArticleSelector"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Ccontrol="clr-namespace:RSSReader.MobileClient.Model"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}">


    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <Style x:Key="borderStyle" TargetType="Border">
                <Setter Property="BorderBrush" Value="#1C1C1C" />
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="Padding" Value="1" />
            </Style>
        </Grid.Resources>
        
        <ListBox ItemsSource="{Binding}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border Style="{StaticResource borderStyle}">
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{Binding Path=isReadBrush}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="50"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="50" />
                            </Grid.ColumnDefinitions>
                            <HyperlinkButton x:Name="Favit" Background="{Binding isFavBrush}" Height="50" Width="50" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" NavigateUri="{Binding Path=Favit}"/>
                            <Grid Grid.Column="1">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="30"/>
                                </Grid.RowDefinitions>
                                <TextBlock x:Name="Title" TextWrapping="Wrap" Text="{Binding Path=Title, Mode=OneWay}" Grid.Row="0" VerticalAlignment="Center" FontSize="16" FontWeight="Bold"/>
                                <TextBlock x:Name="Body" TextTrimming="WordEllipsis" Text="{Binding Path=Body, Mode=OneWay}" Grid.Row="1" VerticalAlignment="Center" FontSize="16"/>
                            </Grid>
                            <HyperlinkButton x:Name="FollowArticle" NavigateUri="{Binding Path=Link, Mode=OneWay}" Click="FollowArticle_Click" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderBrush="White" Foreground="Black"  Width="50" Height="50" BorderThickness="0">
                                <HyperlinkButton.Background>
                                    <ImageBrush Stretch="Fill" ImageSource="/Images/transport.play.png"/>
                                </HyperlinkButton.Background>
                                </HyperlinkButton>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>